﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Web;
using System.Web.Mvc;
using MVCSampleApp.Models;

namespace MVCSampleApp.Controllers
{
  public class ResultController : Controller
  {
    //
    // GET: /Result/

    public ActionResult Index()
    {
      return View();
    }


    public ActionResult ContentDemo()
    {
      return Content("Hello World", "text/plain");
    }

    public ActionResult JavaScriptDemo()
    {
      return JavaScript("<script>function foo { alert('foo'); }</script>");
    }

    public ActionResult JsonDemo()
    {
      var m = new Menu
      {
        Id = 3,
        Text = "Grilled sausage with sauerkraut und potatoes",
        Price = 12.90,
        Category = "Main"
      };
      return Json(m, JsonRequestBehavior.AllowGet);
    }

    public ActionResult RedirectDemo()
    {
      return Redirect("http://www.cninnovation.com");
    }

    public ActionResult RedirectRouteDemo()
    {
      return RedirectToRoute(new { controller = "Home", action="Hello" });
    }

    public ActionResult FileDemo()
    {
      return File("~/Content/Images/Stephanie.jpg", "image/jpg");
    }


  }
}
